package com.tanhua.model.vo;

import com.tanhua.model.domain.UserInfo;
import com.tanhua.model.mongo.RecommendUser;
import com.tanhua.model.mongo.UserLike;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

/**
 * @author げっしょく
 * @date 2021/11/1
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserInfoTVO {
    private Long id; //用户id
    private String avatar; //用户头像
    private String nickname; //昵称
    private String gender; //性别
    private Integer age; //年龄
    private String city; //城市
    private String education; //学历
    private Integer marriage; //婚姻状态
    private Integer matchRate = 66; //匹配度
    private Boolean alreadyLove = false; //是否喜欢ta

    public static UserInfoTVO init(UserInfo userInfo, Boolean b, Double socre) {
        UserInfoTVO userInfoTVO = new UserInfoTVO();
        BeanUtils.copyProperties(userInfo, userInfoTVO);
        if (b != null) {
            userInfoTVO.setAlreadyLove(b);
        }
        if (socre != null) {
            userInfoTVO.setMatchRate(Integer.valueOf(socre.intValue()));
        }


        return userInfoTVO;
    }

}
